<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>

    /*
       一个函数值，该函数作为创建派生对象的构 造函数
       用 Symbol.species 定义静态的获取器(getter)方法，可以覆盖新创建实例的原型定义
     */

    class Bar extends Array {
    }

    class Baz extends Array {
        static get [Symbol.species]() {
            return Array;
        }
    }

    let bar = new Bar();
    console.log(bar instanceof Array);
    console.log(bar instanceof Bar);
    bar = bar.concat('bar');
    console.log(bar instanceof Array);
    console.log(bar instanceof Bar);
    let baz = new Baz();
    console.log(baz instanceof Array);
    console.log(baz instanceof Baz);
    baz = baz.concat('baz');
    console.log(baz instanceof Array);
    console.log(baz instanceof Baz);  // false

</script>
</body>
</html>